package cn.itlaobing.web.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import cn.itlaobing.service.StudentService;
@Controller("/students/delete")
public class StudentDelete extends BaseController{
	Log log=LogFactory.getLog(StudentDelete.class);
	@Autowired
	private StudentService studentService;
	
	@Override
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String id=request.getParameter("id");
		studentService.delete(Long.valueOf(id));
		redirectTo("/students/home", request, response);
		//request.getRequestDispatcher("/students/home").forward(request, response);
	}
}
